<template>
    <div>
        <button @click="handleAdd">testMutations{{$store.$state.count}}</button>
        <button @click="handleAddAction">testActions</button>
    </div>
</template>

<script>
    export default {
           methods:{
               handleAdd(){
                   this.$store.commit("add",2)

                   console.log(this.$store.$state.count)
               },
               handleAddAction(){
                   this.$store.dispatch("handleAdd",22)
               }
           }
    }
</script>

<style scoped>
button{
    font-size: 2rem;
}
</style>